package pages;

import org.openqa.selenium.WebElement;

import io.appium.java_client.AppiumBy;
import io.appium.java_client.android.AndroidDriver;
import utiles.BaseAction;

public class LogPage {
	AndroidDriver driver;
	BaseAction action;
	
	public LogPage(AndroidDriver driver) {
		this.driver=driver;
		action=new BaseAction(driver);
	}
	
	public WebElement btn_exerciseGoal() {
		return driver.findElement(AppiumBy.id("njust.dzh.fitnesssystem:id/tv_goal"));
	}
	
	public void clickExerciseGoal() throws InterruptedException {
		action.click(this.btn_exerciseGoal());
	}
	
	public GoalPage clickExerciseGoalSuccess() throws InterruptedException {
		clickExerciseGoal();
		return new GoalPage(driver);
	}
	
	public WebElement btn_exerciseResult() {
		return driver.findElement(AppiumBy.id("njust.dzh.fitnesssystem:id/tv_result"));
	}
	
	public void clickExerciseResult() throws InterruptedException {
		action.click(this.btn_exerciseResult());
	}
	
	public ResultPage clickExerciseResultSuccess() throws InterruptedException {
		clickExerciseResult();
		return new ResultPage(driver);
	}

}
